<template>
  <div>
    <!-- 课程内容 -->
    <div class="container">
      <div class="curriculum_item1">
        <div class="curriculum_title">超级简历</div>
        <div class="curriculum_imgs">
          <div class="swiper">
            <van-swipe
              class="my-swipe"
              :autoplay="3000"
              indicator-color="white"
            >
              <van-swipe-item v-for="item in bannerLists" :key="item.Id">
                <router-link
                  tag="div"
                  :to="{ name: 'atising', query: { id: item.name } }"
                >
                  <img :src="item.srcs" alt="" />
                </router-link>
              </van-swipe-item>
              <template #indicator>
                <div class="custom-indicator"></div>
              </template>
            </van-swipe>
          </div>
        </div>
      </div>
      <div class="curriculum_item2">
        <div class="curriculum_title">限时推荐</div>
        <div class="curriculum_item2_box">
          <div class="item2_box_imgs">
            <!-- 运营实战 -->
          </div>
          <div class="item2_box_text">
            <!-- 运营实战 -->
            <div class="item2_box_text_title">
              <p class="one">特训营 | 互联网运营求职逆袭</p>
              <span>求职规划+实习证明=Offer</span><br />
              <span class="text">4周运营实战</span>
              <p class="tow">￥<i>惊喜价</i><del>3699</del></p>
            </div>
            <div class="box_run">
              <router-link
                tag="div"
                :to="{ name: 'atising', query: { id: 'one' } }"
                class="box_run_a"
              >
                惊喜价
              </router-link>
            </div>
          </div>
        </div>
      </div>
      <div class="curriculum_item3">
        <div class="curriculum_title">热门课程</div>

        <div class="item3_box">
          <!-- 广告卡 -->
          <router-link
            tag="div"
            :to="{ name: 'atising', query: { id: 'one' } }"
            class="curriculum_pro"
            v-for="item in cuLists"
            :key="item.id"
          >
            <div class="curriculum_pro_imgs">
              <img :src="item.srcs" alt="" />
              <div class="pro_text">{{ item.text }}</div>
            </div>
            <div class="curriculum_pro_text">
              <p v-for="(texts, index) in item.texts" :key="index">
                {{ texts }}
              </p>
            </div>
            <div class="curriculum_pro_time">{{ item.time }}</div>
          </router-link>
        </div>
      </div>
    </div>

    <!-- 课程内容 END-->
    <div class="shroud">
      <div class="container container_ji">
        <div class="shroudPanel">
          <div class="icon">
            <router-link to="/home" tag="div" class="iconrun"></router-link>
            <div class="img index">
              <img
                src="../assets/imgs/src_assets_img_tab_tab_cv_normal.png"
                alt=""
              />
            </div>
            <span>首页</span>
          </div>
          <div class="icon">
            <router-link to="/jobwant" tag="div" class="iconrun"></router-link>
            <div class="img">
              <img
                src="../assets/imgs/src_assets_img_tab_tab_job_normal.png"
                alt=""
              />
            </div>
            <span>求职</span>
          </div>
          <div class="icon">
            <router-link to="/curr" tag="div" class="iconrun"></router-link>
            <div class="img">
              <img
                src="../assets/imgs/src_assets_img_tab_tab_lesson_selected.png"
                alt=""
              />
            </div>
            <span>课程</span>
          </div>
          <div class="icon">
            <router-link to="/message" tag="div" class="iconrun"></router-link>
            <div class="img message">
              <img
                src="../assets/imgs/src_assets_img_tab_tab_message_normal.png"
                alt=""
              />
              <ul class="list_message">
                <!-- <div class="message_sum">99+</div> -->
              </ul>
            </div>
            <span class="con">消息</span>
          </div>
          <div class="icon">
            <router-link to="/personal" tag="div" class="iconrun"></router-link>
            <div class="img">
              <img
                src="../assets/imgs/src_assets_img_tab_tab_me_normal.png"
                alt=""
              />
            </div>
            <span>我</span>
          </div>
        </div>
      </div>
    </div>
    <div class="shr"></div>
    <!-- 底部固定导航栏 END-->
  </div>
</template>

<script>
import { getCurrJsonData } from "../api/curr.js";

export default {
  data() {
    return {
      bannerLists: null,
      cuLists: null,
    };
  },
  methods: {
    getBannerListsFun() {
      getCurrJsonData().then((data) => {
        this.bannerLists = data.bannerLists;
      });
    },
    getCuListsFun() {
      getCurrJsonData().then((data) => {
        this.cuLists = data.cuLists;
      });
    },
  },
  created() {
    this.getBannerListsFun();
    this.getCuListsFun();
  },
};
</script>

<style lang="scss" scoped>
// 轮播图
.swiper {
  border-radius: 10px;
  padding: 0px 2px;
  overflow: hidden;
  img {
    width: 100%;
    display: block;
  }
  .custom-indicator {
    width: 100%;
    position: absolute;
    left: 0px;
    bottom: 0px;
    text-align: center;
    ul {
      display: inline-block;
      margin: 0 auto;
      li {
        display: inline-block;
        width: 6px;
        height: 2px;
        margin: 0px 2px;
        background-color: rgba(255, 255, 255, 0.6);
        &.con {
          background-color: #fff;
        }
      }
    }
  }
}

.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 0px;
  text-align: center;
  background-color: #39a9ed;
}

/* 内容 */
.curriculum_item2,
.curriculum_item3,
.curriculum_item1 {
  box-sizing: border-box;
  padding: 0 25px;
}
.curriculum_title {
  height: 52px;
  line-height: 52px;
  font-size: 22px;
  font-weight: 600;
  color: #000;
}
.curriculum_item1 {
  .curriculum_imgs {
    width: 100%;
    height: 147px;
    margin-top: 15px;
    margin-bottom: 25px;
    border-radius: 10px;
    overflow: hidden;
  }
}
.curriculum_item2 {
  .curriculum_imgs {
    width: 100%;
    height: 147px;
    overflow: hidden;
  }
}
.curriculum_item2_box {
  display: flex;
  height: 127px;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background-color: #fff;
  justify-content: space-around;
  .item2_box_imgs {
    box-sizing: border-box;
    width: 20%;
    height: 100%;
    background: url(../assets/imgs/广告2-2.png) no-repeat center center;
    background-size: 100%;
  }
  .item2_box_text {
    width: 70%;
    position: relative;
  }
}
.item2_box_text {
  .item2_box_text_title {
    .one {
      display: block;
      font-size: 16px;
      height: 16px;
      line-height: 16px;
      color: #000;
      margin-top: 20px;
      font-weight: 800;
    }
    span {
      display: inline-block;
      font-size: 12px;
      height: 16px;
      line-height: 16px;
      color: #999;
      margin-top: 8px;
      margin-bottom: 12px;
    }
    .text {
      margin: 0px;
      height: 23px;
      line-height: 23px;
    }
  }
  .box_run {
    position: absolute;
    box-sizing: border-box;
    bottom: 14px;
    right: 14px;
    padding: 5px 7px 8px;
    font-size: 14px;
    border-radius: 7px;
    border: 1px solid #ee8a2a;
    background-color: #f39b44;
    .box_run_a {
      color: #fff;
    }
  }
}
.item2_box_text_title {
  .tow {
    font-size: 12px;
    color: #e16644;
    i {
      font-style: normal;
      font-size: 16px;
      color: #e16644;
      padding: 0 5px;
    }
    del {
      font-size: 12px;
      color: #808080;
    }
  }
}
.item3_box {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  .curriculum_pro {
    width: 48%;
    height: 195px;
    background-color: #fff;
    border-radius: 10px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
  }
}
.curriculum_pro {
  .curriculum_pro_time {
    position: absolute;
    box-sizing: border-box;
    font-size: 12px;
    border-radius: 4px;
    color: #fa795c;
    background-color: #feefec;
    padding: 3px 7px 4px;
    bottom: 10px;
    left: 8px;
  }
  .curriculum_pro_imgs {
    height: 92px;
    overflow: hidden;
    position: relative;
    img {
      width: 100%;
      height: 92px;
    }
    .pro_text {
      position: absolute;
      width: 34px;
      height: 18px;
      top: 4px;
      left: 6px;
      color: #fff;
      font-size: 12px;
      text-align: center;
      line-height: 18px;
      border-radius: 4px;
      background-color: #ff2c01;
    }
  }
  .curriculum_pro_text {
    p {
      &:nth-child(1) {
        height: 34px;
        line-height: 34px;
        font-size: 14px;
        color: #000;
        font-weight: 800;
        padding: 0 8px;
      }
      &:nth-child(2) {
        height: 12px;
        line-height: 12px;
        font-size: 12px;
        color: #999;
        margin-bottom: 7px;
        padding: 0 8px;
      }
      &:nth-child(3) {
        height: 12px;
        line-height: 12px;
        font-size: 12px;
        color: #999;
        margin-bottom: 7px;
        padding: 0 8px;
      }
    }
  }
}
/* 底部固定导航栏 */
.shr {
  height: 52px;
}
.shroud {
  position: fixed;
  bottom: 0px;
  right: 0px;
  left: 0px;
  .shroudPanel {
    display: flex;
    height: 52px;
    justify-content: space-between;
    text-align: center;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    background-color: #ffffff;
    & > .icon {
      margin-right: 17px;
      box-sizing: border-box;
      position: relative;
      margin-left: 17px;
      height: 52px;
      padding-top: 4px;
      flex: 1;
      .iconrun {
        display: block;
        position: absolute;
        width: 100%;
        height: 100%;
        z-index: 999;
      }
      .img {
        img {
          width: 26px;
          height: 26px;
        }
      }
    }
    .icon {
      & > span {
        display: block;
        font-size: 9px;
        color: #5d5d5d;
        height: 10px;
        line-height: 10px;
      }
      & > .con {
        color: #555565;
      }
    }
  }
}
.message {
  position: relative;
  .list_message {
    position: absolute;
    width: 19px;
    height: 30px;
    top: 0px;
    left: 0px;
    right: 0px;
    margin: 0 auto;
  }
  .message_sum {
    position: absolute;
    box-sizing: border-box;
    width: 28px;
    height: 18px;
    background-color: #ff522d;
    border: 1px solid #fb4d2a;
    font-size: 12px;
    color: #fff;
    border-radius: 10px;
    top: -5px;
    right: -20px;
  }
}
.list_message {
  .item_message {
    display: block;
    float: left;
    width: 3px;
    height: 3px;
    margin-top: 11px;
    margin-left: 3px;
    background-color: #fff;
  }
}
</style>